import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'

//查询教师列表
export const teacherListService = ()=>{
    //const tokenStore = useTokenStore();
    //在pinia中定义的响应式数据,都不需要.value
    //return request.get('/teacher',{headers:{'Authorization':tokenStore.token}})
    return request.get('/teacherlist')
}

//教师搜索
export const teacherSearchService = (teacherData)=>{
    return request.get('/teacher',teacherData)
}

//教师添加
export const teacherAddService = (teacherData)=>{
    return request.post('/teacher',teacherData)
}

//教师信息修改
export const teacherUpdateService = (teacherData)=>{
   return  request.put('/teacher',teacherData)
}

//教师密码重置（默认密码：123456）
export const teacherResetPasswordService = (id)=>{
    return  request.put('/teacher?id='+id)
}

//教师删除
export const teacherDeleteService = (id)=>{
    return request.delete('/teacher?id='+id)
}


